package com.awesome.activitydemo.utils;

import android.app.Application;

/**
 * Author: zhangjingfang
 * Email:zhangjingfang@jeejio.com
 * Date: 2022/3/10
 * Description:加生命周期监听
 */
public class MyApp extends Application {
    private ActLifecycle mActLifecycle = new ActLifecycle();

    private MyApp instance;

    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;
        registerActivityLifecycleCallbacks(mActLifecycle);
        mActLifecycle.setOnForeListener(new ActLifecycle.onForeListener() {
            @Override
            public void onFore(boolean isFore) {

            }
        });
    }
}
 
 